<%@ page language="java" contentType="text/html;charset=utf8" pageEncoding="utf8" %>
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hello world!</title>
    <!-- zui -->
    <link href="zui/css/zui.min.css" rel="stylesheet">
  </head>
  <body>
	<div class="container">
	<h1>POI操作PPT</h1>
	<div style="margin:10px 0"><a href="${basePath}/file/temp.pptx"><i class="icon-arrow-down"></i>模板文件</a>

   	</div>
	
    <!-- 在此处编码你的创意 -->
    <div class="list-group">
	  <a href="#" id="poi-text" class="list-group-item panel-info">
	    <h4 class="list-group-item-heading">替换ppt文本</h4>
	    <p class="list-group-item-text text-muted">将PPT中第一页的诗词补充完整</p>
	  </a>
	  <a href="#" class="list-group-item panel-success">
	    <h4 class="list-group-item-heading">填充ppt表格</h4>
	    <p class="list-group-item-text text-muted">编程语言排行榜</p>
	  </a>
	  <a href="#" class="list-group-item panel-danger">
	    <h4 class="list-group-item-heading">填充ppt饼状图</h4>
	    <p class="list-group-item-text text-muted">IT产业人才分布</p>
	  </a>
	</div>
	</div>
    <!-- jQuery (ZUI中的Javascript组件依赖于jQuery) -->
    <script src="zui/lib/jquery/jquery.js"></script>
    <!-- ZUI Javascript组件 -->
    <script src="zui/js/zui.min.js"></script>
    <script>
    $("#poi-text").bind("click",function(){
    	$.post("${basePath}/poi_text",
    		    {
    		        
    		    },
    		    function(data,status){
    		    	if(data.status == false)
    		        	alert("错误: \n" + data.msg);
    		    	else{
    		    		var url = "${basePath}/download/"+data.msg;
   		    	        var fileName = data.msg;
   		    	        var form = $("<form></form>").attr("action", url).attr("method", "post");
   		    	        form.append($("<input></input>").attr("type", "hidden").attr("name", "fileName").attr("value", fileName));
   		    	        form.appendTo('body').submit().remove();
    		    	}
    		    });
    });
    </script>
  </body>
</html>